<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>反向输出</title>
</head>
<body>
    <script>
        function gu(arr){
            var rui=[];
            for(var i=0;i<arr.length;i++){
                rui[i]=arr[arr.length-1-i];
            }
            return rui;
        }
        document.write(gu([1,2,3,,4,5,6]));
    </script>
</body>
</html>